using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace ICP_MS.Plugin.LA300;

public class FormConcentration : Form
{
	private ExperimentDatas experiment = null;

	private ExperimentDB db = null;

	private ComboBox box = null;

	private IContainer components = null;

	private DbufferGrid dgvSA;

	private TabControl tabControl1;

	private TabPage pageFQ;

	private TabPage pageSA;

	private DbufferGrid dgvFQ;

	public FormConcentration()
	{
		InitializeComponent();
	}

	public void SetParams(ExperimentDatas experiment, ExperimentDB db)
	{
		this.experiment = experiment;
		this.db = db;
	}

	private void experiment_isotopeChanged(object sender, EventArgs e)
	{
		InitDtSamples();
		experiment.FillStdConcentration();
		BindStdConcentration();
	}

	private void experiment_istdChanged(object sender, EventArgs e)
	{
		InitDtSamples();
		experiment.FillStdConcentration();
		BindStdConcentration();
	}

	private void experiment_methodChanged(object sender, EventArgs e)
	{
		InitDtSamples();
		experiment.FillStdConcentration();
		BindStdConcentration();
	}

	private void experiment_sampleChanged(object sender, EventArgs e)
	{
		experiment.FillStdConcentration();
		BindStdConcentration();
	}

	private void BindStdConcentration()
	{
		BindFQConcentration();
		BindSAConcentration();
	}

	private void InitDtSamples()
	{
		InitFQHeader();
		InitSAHeader();
	}

	private void FormConcentration_Load(object sender, EventArgs e)
	{
		base.WindowState = FormWindowState.Maximized;
		dgvFQ.VerCopy = true;
		dgvFQ.HorCopy = true;
		dgvSA.VerCopy = true;
		dgvSA.HorCopy = true;
		InitDtSamples();
		experiment.FillStdConcentration();
		BindStdConcentration();
		experiment.isotopeChanged += experiment_isotopeChanged;
		experiment.istdChanged += experiment_istdChanged;
		experiment.sampleChanged += experiment_sampleChanged;
		experiment.methodChanged += experiment_methodChanged;
		ApplyResources();
	}

	private void ApplyResources()
	{
		Text = Lang.Txt("FormConcentration.Title.Text");
		pageFQ.Text = Lang.Txt("FormConcentration.PageFQ.Text");
		pageSA.Text = Lang.Txt("FormConcentration.PageSA.Text");
	}

	private void FormConcentration_FormClosing(object sender, FormClosingEventArgs e)
	{
		experiment.isotopeChanged -= experiment_isotopeChanged;
		experiment.istdChanged -= experiment_istdChanged;
		experiment.sampleChanged -= experiment_sampleChanged;
		experiment.methodChanged -= experiment_methodChanged;
	}

	private void dgvStdConcentration_CellValueChanged(object sender, DataGridViewCellEventArgs e)
	{
		int rowIndex = e.RowIndex;
		int colIndex = e.ColumnIndex;
		DataGridView dgv = sender as DataGridView;
		if (rowIndex > 0 && colIndex > 1 && !dgv.Columns[colIndex].ReadOnly)
		{
			try
			{
				double value = Convert.ToDouble(dgv[colIndex, rowIndex].Value);
				int id = Convert.ToInt32(dgv[0, rowIndex].Value);
				string symbol = dgv.Columns[colIndex].HeaderText;
				IEnumerable<StandardConcentration> tmp = experiment.StdConcentration.Where((StandardConcentration std) => std.symbol == symbol && std.sample == id);
				tmp.ElementAt(0).concentration = value;
				dgv[colIndex, rowIndex].Style.ForeColor = Color.Black;
			}
			catch
			{
				dgv[colIndex, rowIndex].Style.ForeColor = Color.Red;
			}
		}
		experiment.Dirty.STDConcDirty = true;
	}

	private void dgvStdConcentration_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		int rowIndex = e.RowIndex;
		int colIndex = e.ColumnIndex;
		DataGridView dgv = sender as DataGridView;
		if (rowIndex <= 0 || colIndex <= 1)
		{
			return;
		}
		if (dgv.Columns[colIndex].ReadOnly)
		{
			e.Value = "NA";
			return;
		}
		try
		{
			double value = Convert.ToDouble(e.Value);
			if (value < 0.0)
			{
				e.Value = "";
			}
			else
			{
				e.Value = Convert.ToDouble(e.Value).ToString("F4");
			}
		}
		catch
		{
			e.Value = -1;
		}
	}

	private void dgvStdConcentration_CurrentCellChanged(object sender, EventArgs e)
	{
		DataGridView dgv = sender as DataGridView;
		if (dgv.CurrentCell == null)
		{
			return;
		}
		int rowIndex = dgv.CurrentCell.RowIndex;
		int columnIndex = dgv.CurrentCell.ColumnIndex;
		if (rowIndex != 0 || dgv.Columns[columnIndex].ReadOnly)
		{
			return;
		}
		box = new ComboBox();
		box.Parent = dgv;
		box.DropDownStyle = ComboBoxStyle.DropDownList;
		Rectangle rect = dgv.GetCellDisplayRectangle(columnIndex, rowIndex, cutOverflow: false);
		box.Left = rect.Left;
		box.Top = rect.Top;
		box.Width = rect.Width;
		box.Height = rect.Height;
		box.Visible = true;
		box.Items.Add("ppb");
		box.Items.Add("ppq");
		box.Items.Add("ppt");
		box.Items.Add("ppm");
		box.Items.Add("%");
		string oldUnits = dgv.CurrentCell.Value.ToString();
		box.SelectedItem = oldUnits;
		string newUnits = oldUnits;
		box.DropDown += delegate
		{
			oldUnits = dgv.CurrentCell.Value.ToString();
		};
		box.SelectedIndexChanged += delegate
		{
			newUnits = box.SelectedItem.ToString();
			if (newUnits != oldUnits)
			{
				string symbol = dgv.Columns[columnIndex].HeaderText;
				IEnumerable<IsotopeInfos> enumerable = experiment.Isotopes.Where((IsotopeInfos isotope) => isotope.symbol.Contains(symbol));
				IEnumerable<StandardConcentration> enumerable2 = experiment.StdConcentration.Where((StandardConcentration std) => std.symbol.Contains(symbol));
				if (enumerable != null && enumerable.Count() > 0 && enumerable2 != null && enumerable2.Count() > 0)
				{
					foreach (IsotopeInfos current in enumerable)
					{
						current.units = box.SelectedItem.ToString();
					}
					dgv.CurrentCell.Value = box.SelectedItem.ToString();
					foreach (StandardConcentration current2 in enumerable2)
					{
						double num = current2.concentration;
						switch (oldUnits)
						{
						case "%":
							num *= Math.Pow(10.0, 7.0);
							break;
						case "ppm":
							num *= Math.Pow(10.0, 3.0);
							break;
						case "ppb":
							num *= 1.0;
							break;
						case "ppt":
							num *= Math.Pow(10.0, -3.0);
							break;
						case "ppq":
							num *= Math.Pow(10.0, -6.0);
							break;
						}
						switch (newUnits)
						{
						case "%":
							num *= Math.Pow(10.0, -7.0);
							break;
						case "ppm":
							num *= Math.Pow(10.0, -3.0);
							break;
						case "ppb":
							num *= 1.0;
							break;
						case "ppt":
							num *= Math.Pow(10.0, 3.0);
							break;
						case "ppq":
							num *= Math.Pow(10.0, 6.0);
							break;
						}
						current2.concentration = num;
					}
					if (dgv.Equals(dgvFQ))
					{
						BindFQConcentration();
					}
					else
					{
						BindSAConcentration();
					}
				}
			}
		};
	}

	private void dgvStdConcentration_CellLeave(object sender, DataGridViewCellEventArgs e)
	{
		if (box != null)
		{
			box.Dispose();
			box = null;
		}
	}

	private void InitFQHeader()
	{
		((DataGridView)(object)dgvFQ).Columns.Clear();
		((DataGridView)(object)dgvFQ).Rows.Clear();
		((DataGridView)(object)dgvFQ).AllowUserToAddRows = false;
		((DataGridView)(object)dgvFQ).AllowUserToDeleteRows = false;
		if (experiment.Isotopes.Where((IsotopeInfos isotope) => isotope.method == 1 && isotope.visible).Count() == 0)
		{
			return;
		}
		int colIndex = ((DataGridView)(object)dgvFQ).Columns.Add("colFQNumber", Lang.Txt("FormConcentration.Columns.Seq.Text"));
		((DataGridView)(object)dgvFQ).Columns[colIndex].ReadOnly = true;
		((DataGridView)(object)dgvFQ).Columns[colIndex].SortMode = DataGridViewColumnSortMode.NotSortable;
		colIndex = ((DataGridView)(object)dgvFQ).Columns.Add("colFQLabel", Lang.Txt("FormConcentration.Columns.Label.Text"));
		((DataGridView)(object)dgvFQ).Columns[colIndex].ReadOnly = true;
		((DataGridView)(object)dgvFQ).Columns[colIndex].SortMode = DataGridViewColumnSortMode.NotSortable;
		foreach (IsotopeInfos isotope2 in experiment.Isotopes)
		{
			if (isotope2.method != 1 || !isotope2.visible)
			{
				continue;
			}
			bool IsExist = false;
			foreach (DataGridViewColumn col in ((DataGridView)(object)dgvFQ).Columns)
			{
				if (isotope2.symbol.Contains(col.HeaderText))
				{
					IsExist = true;
					break;
				}
			}
			if (!IsExist)
			{
				string headertext = Regex.Replace(isotope2.symbol, "[0-9]", "", RegexOptions.IgnoreCase);
				string name = "colFQ" + headertext;
				colIndex = ((DataGridView)(object)dgvFQ).Columns.Add(name, headertext);
				if (isotope2.inter)
				{
					((DataGridView)(object)dgvFQ).Columns[colIndex].DefaultCellStyle.BackColor = Color.Yellow;
					((DataGridView)(object)dgvFQ).Columns[colIndex].ReadOnly = true;
				}
				((DataGridView)(object)dgvFQ).Columns[colIndex].SortMode = DataGridViewColumnSortMode.NotSortable;
			}
		}
		int rowIndex = ((DataGridView)(object)dgvFQ).Rows.Add();
		int i;
		for (i = 2; i < ((DataGridView)(object)dgvFQ).Columns.Count; i++)
		{
			IEnumerable<string> units = from isotope in experiment.Isotopes
				where isotope.symbol.Contains(((DataGridView)(object)dgvFQ).Columns[i].HeaderText)
				select isotope.units;
			if (units != null && units.Count() > 0)
			{
				((DataGridView)(object)dgvFQ)[i, rowIndex].Value = units.ElementAt(0);
			}
			else
			{
				((DataGridView)(object)dgvFQ)[i, rowIndex].Value = "ppb";
			}
			((DataGridView)(object)dgvFQ)[i, rowIndex].ReadOnly = true;
		}
	}

	private void BindFQConcentration()
	{
		if (((DataGridView)(object)dgvFQ).Columns.Count == 0)
		{
			return;
		}
		while (((DataGridView)(object)dgvFQ).Rows.Count > 1)
		{
			((DataGridView)(object)dgvFQ).Rows.RemoveAt(((DataGridView)(object)dgvFQ).Rows.Count - 1);
		}
		foreach (SamplesInfos sample in experiment.Samples)
		{
			if (sample.type != 1)
			{
				continue;
			}
			int rowIndex = ((DataGridView)(object)dgvFQ).Rows.Add();
			((DataGridView)(object)dgvFQ).Rows[rowIndex].Cells[0].Value = sample.guid;
			((DataGridView)(object)dgvFQ).Rows[rowIndex].Cells[1].Value = sample.label;
			int i;
			for (i = 2; i < ((DataGridView)(object)dgvFQ).Columns.Count; i++)
			{
				IEnumerable<double> tmp = from standard in experiment.StdConcentration
					where standard.sample == sample.guid && standard.symbol == ((DataGridView)(object)dgvFQ).Columns[i].HeaderText
					select standard.concentration;
				if (tmp != null && tmp.Count() > 0)
				{
					((DataGridView)(object)dgvFQ)[i, rowIndex].Value = tmp.ElementAt(0);
				}
				else
				{
					((DataGridView)(object)dgvFQ)[i, rowIndex].Value = 5;
				}
			}
		}
	}

	private void InitSAHeader()
	{
		((DataGridView)(object)dgvSA).Columns.Clear();
		((DataGridView)(object)dgvSA).Rows.Clear();
		((DataGridView)(object)dgvSA).AllowUserToAddRows = false;
		((DataGridView)(object)dgvSA).AllowUserToDeleteRows = false;
		if (experiment.Isotopes.Where((IsotopeInfos isotope) => isotope.method == 2 && isotope.visible).Count() == 0)
		{
			return;
		}
		int colIndex = ((DataGridView)(object)dgvSA).Columns.Add("colSANumber", Lang.Txt("FormConcentration.Columns.Seq.Text"));
		((DataGridView)(object)dgvSA).Columns[colIndex].ReadOnly = true;
		((DataGridView)(object)dgvSA).Columns[colIndex].SortMode = DataGridViewColumnSortMode.NotSortable;
		colIndex = ((DataGridView)(object)dgvSA).Columns.Add("colSALabel", Lang.Txt("FormConcentration.Columns.Label.Text"));
		((DataGridView)(object)dgvSA).Columns[colIndex].ReadOnly = true;
		((DataGridView)(object)dgvSA).Columns[colIndex].SortMode = DataGridViewColumnSortMode.NotSortable;
		foreach (IsotopeInfos isotope2 in experiment.Isotopes)
		{
			if (isotope2.method != 2 || !isotope2.visible)
			{
				continue;
			}
			bool IsExist = false;
			foreach (DataGridViewColumn col in ((DataGridView)(object)dgvSA).Columns)
			{
				if (isotope2.symbol.Contains(col.HeaderText))
				{
					IsExist = true;
					break;
				}
			}
			if (!IsExist)
			{
				string headertext = Regex.Replace(isotope2.symbol, "[0-9]", "", RegexOptions.IgnoreCase);
				string name = "colSA" + headertext;
				colIndex = ((DataGridView)(object)dgvSA).Columns.Add(name, headertext);
				if (isotope2.inter)
				{
					((DataGridView)(object)dgvSA).Columns[colIndex].DefaultCellStyle.BackColor = Color.Yellow;
					((DataGridView)(object)dgvSA).Columns[colIndex].ReadOnly = true;
				}
				((DataGridView)(object)dgvSA).Columns[colIndex].SortMode = DataGridViewColumnSortMode.NotSortable;
			}
		}
		int rowIndex = ((DataGridView)(object)dgvSA).Rows.Add();
		int i;
		for (i = 2; i < ((DataGridView)(object)dgvSA).Columns.Count; i++)
		{
			IEnumerable<string> units = from isotope in experiment.Isotopes
				where isotope.symbol.Contains(((DataGridView)(object)dgvSA).Columns[i].HeaderText)
				select isotope.units;
			if (units != null && units.Count() > 0)
			{
				((DataGridView)(object)dgvSA)[i, rowIndex].Value = units.ElementAt(0);
			}
			else
			{
				((DataGridView)(object)dgvSA)[i, rowIndex].Value = "ppb";
			}
			((DataGridView)(object)dgvSA)[i, rowIndex].ReadOnly = true;
		}
	}

	private void BindSAConcentration()
	{
		if (((DataGridView)(object)dgvSA).Columns.Count == 0)
		{
			return;
		}
		while (((DataGridView)(object)dgvSA).Rows.Count > 1)
		{
			((DataGridView)(object)dgvSA).Rows.RemoveAt(((DataGridView)(object)dgvSA).Rows.Count - 1);
		}
		foreach (SamplesInfos sample in experiment.Samples)
		{
			if (sample.type != 2)
			{
				continue;
			}
			int rowIndex = ((DataGridView)(object)dgvSA).Rows.Add();
			((DataGridView)(object)dgvSA).Rows[rowIndex].Cells[0].Value = sample.guid;
			((DataGridView)(object)dgvSA).Rows[rowIndex].Cells[1].Value = sample.label;
			int i;
			for (i = 2; i < ((DataGridView)(object)dgvSA).Columns.Count; i++)
			{
				IEnumerable<double> tmp = from standard in experiment.StdConcentration
					where standard.sample == sample.guid && standard.symbol == ((DataGridView)(object)dgvSA).Columns[i].HeaderText
					select standard.concentration;
				if (tmp != null && tmp.Count() > 0)
				{
					((DataGridView)(object)dgvSA)[i, rowIndex].Value = tmp.ElementAt(0);
				}
				else
				{
					((DataGridView)(object)dgvSA)[i, rowIndex].Value = 5;
				}
			}
		}
	}

	private void dgvFQ_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
	{
		if (e.Button == MouseButtons.Right && e.ColumnIndex >= 0 && e.RowIndex >= 0)
		{
			ContextMenu menu = new ContextMenu();
			menu.MenuItems.Add(Lang.Txt("FormConcentration.ApplyToOthers.Text"), delegate
			{
				string headerText = ((DataGridView)(object)dgvFQ).Columns[e.ColumnIndex].HeaderText;
				ApplyColumns(1, headerText);
				BindFQConcentration();
			});
			menu.MenuItems.Add(Lang.Txt("FormConcentration.Copy.Text"), delegate
			{
				SendKeys.Send("^C");
			});
			MenuItem itemCopy = menu.MenuItems.Add("FormConcentration.Paste.Text", delegate
			{
				PasteDatas((DataGridView)(object)dgvFQ);
			});
			itemCopy.Enabled = Clipboard.ContainsData(DataFormats.CommaSeparatedValue);
			Rectangle rect = ((DataGridView)(object)dgvFQ).GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, cutOverflow: true);
			menu.Show((Control)(object)dgvFQ, new Point(rect.X + e.X, rect.Y + e.Y));
		}
	}

	private void dgvSA_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
	{
		if (e.Button == MouseButtons.Right && e.ColumnIndex >= 0 && e.RowIndex >= 0)
		{
			ContextMenu menu = new ContextMenu();
			menu.MenuItems.Add(Lang.Txt("FormConcentration.ApplyToOthers.Text"), delegate
			{
				string headerText = ((DataGridView)(object)dgvSA).Columns[e.ColumnIndex].HeaderText;
				ApplyColumns(2, headerText);
				BindSAConcentration();
			});
			menu.MenuItems.Add(Lang.Txt("FormConcentration.Copy.Text"), delegate
			{
				SendKeys.Send("^C");
			});
			MenuItem itemCopy = menu.MenuItems.Add("FormConcentration.Paste.Text", delegate
			{
				PasteDatas((DataGridView)(object)dgvSA);
			});
			itemCopy.Enabled = Clipboard.ContainsData(DataFormats.CommaSeparatedValue);
			Rectangle rect = ((DataGridView)(object)dgvSA).GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, cutOverflow: true);
			menu.Show((Control)(object)dgvSA, new Point(rect.X + e.X, rect.Y + e.Y));
		}
	}

	private void ApplyColumns(int method, string symbol)
	{
		foreach (SamplesInfos sample in experiment.Samples)
		{
			if (sample.type != method)
			{
				continue;
			}
			IEnumerable<double> value = from std in experiment.StdConcentration
				where std.symbol == symbol && std.sample == sample.guid
				select std.concentration;
			if (value == null || value.Count() <= 0)
			{
				continue;
			}
			IEnumerable<StandardConcentration> stds = experiment.StdConcentration.Where((StandardConcentration std) => std.sample == sample.guid);
			foreach (StandardConcentration std2 in stds)
			{
				std2.concentration = value.First();
			}
		}
	}

	private void dgvFQ_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Delete)
		{
			Cursor = Cursors.WaitCursor;
			DeleteStandard((DataGridView)(object)dgvFQ);
			BindFQConcentration();
			Cursor = Cursors.Arrow;
		}
		else if (e.Control && e.KeyCode == Keys.V && Clipboard.ContainsData(DataFormats.CommaSeparatedValue))
		{
			PasteDatas((DataGridView)(object)dgvFQ);
		}
	}

	private void DeleteStandard(DataGridView dgv)
	{
		DataGridViewSelectedCellCollection selectedCells = ((DataGridView)(object)dgvFQ).SelectedCells;
		foreach (DataGridViewCell cell in dgv.SelectedCells)
		{
			if (cell.RowIndex > 0 && cell.ColumnIndex > 0)
			{
				int id = Convert.ToInt32(dgv[0, cell.RowIndex].Value);
				string symbol = dgv.Columns[cell.ColumnIndex].HeaderText;
				IEnumerable<StandardConcentration> tmp = experiment.StdConcentration.Where((StandardConcentration std) => std.symbol == symbol && std.sample == id);
				tmp.ElementAt(0).concentration = -1.0;
			}
		}
	}

	private void dgvSA_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Delete)
		{
			Cursor = Cursors.WaitCursor;
			DeleteStandard((DataGridView)(object)dgvSA);
			BindSAConcentration();
			Cursor = Cursors.Arrow;
		}
		if (e.Control && e.KeyCode == Keys.V)
		{
			PasteDatas((DataGridView)(object)dgvSA);
		}
	}

	private void PasteDatas(DataGridView dgv)
	{
		DataGridViewSelectedCellCollection cells = dgv.SelectedCells;
		int rowIndex = 32767;
		int colIndex = 32767;
		foreach (DataGridViewCell cell in cells)
		{
			if (rowIndex > cell.RowIndex && cell.RowIndex > 0)
			{
				rowIndex = cell.RowIndex;
			}
			if (colIndex > cell.ColumnIndex)
			{
				colIndex = cell.ColumnIndex;
			}
		}
		string[] datas = Clipboard.GetData(DataFormats.CommaSeparatedValue).ToString().Split(new string[1] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
		string[][] cellDatas = new string[datas.Length][];
		for (int i = 0; i < datas.Length; i++)
		{
			string[] clips = datas[i].Split(',');
			cellDatas[i] = new string[clips.Length];
			for (int j = 0; j < clips.Length; j++)
			{
				cellDatas[i][j] = clips[j];
			}
		}
		for (int rowIdx = 0; rowIdx < datas.Length && rowIdx + rowIndex < dgv.RowCount; rowIdx++)
		{
			for (int colIdx = 0; colIdx < cellDatas[rowIdx].Length && colIdx + colIndex < dgv.ColumnCount; colIdx++)
			{
				try
				{
					double data = Convert.ToDouble(cellDatas[rowIdx][colIdx]);
					dgv[colIdx + colIndex, rowIdx + rowIndex].Value = data;
				}
				catch
				{
				}
			}
		}
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
		this.dgvSA = new DbufferGrid();
		this.tabControl1 = new System.Windows.Forms.TabControl();
		this.pageFQ = new System.Windows.Forms.TabPage();
		this.dgvFQ = new DbufferGrid();
		this.pageSA = new System.Windows.Forms.TabPage();
		((System.ComponentModel.ISupportInitialize)this.dgvSA).BeginInit();
		this.tabControl1.SuspendLayout();
		this.pageFQ.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvFQ).BeginInit();
		this.pageSA.SuspendLayout();
		base.SuspendLayout();
		((System.Windows.Forms.DataGridView)(object)this.dgvSA).AllowUserToOrderColumns = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvSA).BackgroundColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dgvSA).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
		((System.Windows.Forms.DataGridView)(object)this.dgvSA).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		((System.Windows.Forms.DataGridView)(object)this.dgvSA).DefaultCellStyle = dataGridViewCellStyle2;
		((System.Windows.Forms.Control)(object)this.dgvSA).Dock = System.Windows.Forms.DockStyle.Fill;
		this.dgvSA.HorCopy = false;
		((System.Windows.Forms.Control)(object)this.dgvSA).Location = new System.Drawing.Point(3, 3);
		((System.Windows.Forms.Control)(object)this.dgvSA).Name = "dgvSA";
		dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dgvSA).RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
		((System.Windows.Forms.DataGridView)(object)this.dgvSA).RowTemplate.Height = 23;
		((System.Windows.Forms.Control)(object)this.dgvSA).Size = new System.Drawing.Size(754, 439);
		((System.Windows.Forms.Control)(object)this.dgvSA).TabIndex = 1;
		this.dgvSA.VerCopy = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvSA).CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dgvStdConcentration_CellFormatting);
		((System.Windows.Forms.DataGridView)(object)this.dgvSA).CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(dgvStdConcentration_CellLeave);
		((System.Windows.Forms.DataGridView)(object)this.dgvSA).CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dgvSA_CellMouseDown);
		((System.Windows.Forms.DataGridView)(object)this.dgvSA).CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(dgvStdConcentration_CellValueChanged);
		((System.Windows.Forms.DataGridView)(object)this.dgvSA).CurrentCellChanged += new System.EventHandler(dgvStdConcentration_CurrentCellChanged);
		((System.Windows.Forms.Control)(object)this.dgvSA).KeyDown += new System.Windows.Forms.KeyEventHandler(dgvSA_KeyDown);
		this.tabControl1.Alignment = System.Windows.Forms.TabAlignment.Bottom;
		this.tabControl1.Controls.Add(this.pageFQ);
		this.tabControl1.Controls.Add(this.pageSA);
		this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.tabControl1.Location = new System.Drawing.Point(0, 0);
		this.tabControl1.Name = "tabControl1";
		this.tabControl1.SelectedIndex = 0;
		this.tabControl1.Size = new System.Drawing.Size(776, 474);
		this.tabControl1.TabIndex = 2;
		this.pageFQ.Controls.Add((System.Windows.Forms.Control)(object)this.dgvFQ);
		this.pageFQ.Location = new System.Drawing.Point(4, 4);
		this.pageFQ.Name = "pageFQ";
		this.pageFQ.Padding = new System.Windows.Forms.Padding(3);
		this.pageFQ.Size = new System.Drawing.Size(768, 448);
		this.pageFQ.TabIndex = 0;
		this.pageFQ.Text = "全定量";
		this.pageFQ.UseVisualStyleBackColor = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvFQ).AllowUserToOrderColumns = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvFQ).BackgroundColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dgvFQ).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
		((System.Windows.Forms.DataGridView)(object)this.dgvFQ).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		((System.Windows.Forms.DataGridView)(object)this.dgvFQ).DefaultCellStyle = dataGridViewCellStyle5;
		((System.Windows.Forms.Control)(object)this.dgvFQ).Dock = System.Windows.Forms.DockStyle.Fill;
		this.dgvFQ.HorCopy = false;
		((System.Windows.Forms.Control)(object)this.dgvFQ).Location = new System.Drawing.Point(3, 3);
		((System.Windows.Forms.Control)(object)this.dgvFQ).Name = "dgvFQ";
		dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dgvFQ).RowHeadersDefaultCellStyle = dataGridViewCellStyle6;
		((System.Windows.Forms.DataGridView)(object)this.dgvFQ).RowTemplate.Height = 23;
		((System.Windows.Forms.Control)(object)this.dgvFQ).Size = new System.Drawing.Size(762, 442);
		((System.Windows.Forms.Control)(object)this.dgvFQ).TabIndex = 2;
		this.dgvFQ.VerCopy = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvFQ).CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dgvStdConcentration_CellFormatting);
		((System.Windows.Forms.DataGridView)(object)this.dgvFQ).CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(dgvStdConcentration_CellLeave);
		((System.Windows.Forms.DataGridView)(object)this.dgvFQ).CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dgvFQ_CellMouseDown);
		((System.Windows.Forms.DataGridView)(object)this.dgvFQ).CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(dgvStdConcentration_CellValueChanged);
		((System.Windows.Forms.DataGridView)(object)this.dgvFQ).CurrentCellChanged += new System.EventHandler(dgvStdConcentration_CurrentCellChanged);
		((System.Windows.Forms.Control)(object)this.dgvFQ).KeyDown += new System.Windows.Forms.KeyEventHandler(dgvFQ_KeyDown);
		this.pageSA.Controls.Add((System.Windows.Forms.Control)(object)this.dgvSA);
		this.pageSA.Location = new System.Drawing.Point(4, 4);
		this.pageSA.Name = "pageSA";
		this.pageSA.Padding = new System.Windows.Forms.Padding(3);
		this.pageSA.Size = new System.Drawing.Size(760, 445);
		this.pageSA.TabIndex = 1;
		this.pageSA.Text = "标准加入";
		this.pageSA.UseVisualStyleBackColor = true;
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(776, 474);
		base.Controls.Add(this.tabControl1);
		base.Name = "FormConcentration";
		base.ShowIcon = false;
		this.Text = "FormConcentration";
		base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormConcentration_FormClosing);
		base.Load += new System.EventHandler(FormConcentration_Load);
		((System.ComponentModel.ISupportInitialize)this.dgvSA).EndInit();
		this.tabControl1.ResumeLayout(false);
		this.pageFQ.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dgvFQ).EndInit();
		this.pageSA.ResumeLayout(false);
		base.ResumeLayout(false);
	}
}
